#include<iostream>
#include<vector>
using namespace std;

bool strictly_increasing(vector<int> v){
    if ( v.size() > 1 ) {
        if (v[0] < v[1]) {
            v.erase(v.begin());
            return strictly_increasing(v);
        } else {
            return 0;
        }
    } else {
        return 1;
    }
}

int main(){
    vector<int> vec;
    int input;

    while ( cin >> input ) {
        if (input <= -999999){
            cout << strictly_increasing(vec) << endl;
            vec.clear();
        } else {
            vec.push_back(input);
        }
    }

    return 0;
}

